package LuoGu.搜索.组合的输出;

import java.util.Scanner;

public class Main {
    static int n;
    static int t;
    static int [] ans;
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        t = s.nextInt();
        ans = new int[t+1];
        dfs(1);
    }

    public static void dfs(int k){
        if(k>t){
            for(int i=1;i<=t;i++) System.out.print(String.format("%3d",ans[i]));
            System.out.println();
            return;
        }
        for(int i=ans[k-1]+1;i<=n;i++){
            ans[k] = i;
            dfs(k+1);
        }
    }
}
